{extend name="public/common"} {block name="body"}
<title>基本设置</title>
</head>
<style type="text/css">
	.btn-primary{
		border-radius: 5px;
	}
	.btn-primary:hover{
		background:#e5e5e5;
	 	border-color: #e5e5e5;
	 	color: #333;
	}
.radius:hover{
 	color: #fff;
	border-color: #66b1ff;
	background-color: #66b1ff;
 }
 span:hover{
 	color: #333;
 }
 .btn-primary:hover{
 	color: #fff;
	border-color: #66b1ff;
	background-color: #66b1ff;
 }
 .btn-primary {
    color: #fff;
    background-color: #409eff;
    border-color: #409eff;
    height: 31px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 24px !important;
}
</style>
<body>
  <nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
    
    统计中心
    <span class="c-gray en">&gt;</span>
    注单统计
    <a class="btn btn-success radius r"
      style="line-height: 1.6em; margin-top: 3px"
      href="javascript:location.replace(location.href);" title="刷新">
      <i class="Hui-iconfont">&#xe68f;</i>
    </a>
  </nav>
  
  <div style="padding:20px;height:30px;">
  	
  	<div class="new_box">
  <div class="text-c" style="padding :20px 0;margin-bottom: 30px;">
    <form action="{:url('Statistics/betStatistics')}?select=1" enctype="application/x-www-form-urlencoded" method="post" class="l"  style="margin-left:20px;">区间查询：
    <input type="text" id="sDate1" name="sDate1" value="{$start}" onfocus="WdatePicker({maxDate:'%y-%M-%d'})" class="input-text Wdate" style="width:120px;margin-right:5px;">
    <input type="text" id="sDate2" name="sDate2" value="{$end}" onfocus="WdatePicker({maxDate:'%y-%M-%d'})" class="input-text Wdate" style="width:120px;margin-right:10px;">
    <span class="select-box" style="width:140px;">
    <select class="select" name="id" id="code">
      <option value="0" {if condition="$id == 0"}selected{/if}>全部彩种</option>
      {volist name="caipiao" id="vo"}
        <option value="{$vo.id}" {if condition="$id == $vo.id"}selected{/if}>{$vo.cp_name_new ? $vo.cp_name_new : $vo.cp_name_old}</option>
      {/volist}
      </select>
      </span>
    <button class="btn btn-success" type="submit" style="margin-right:20px;"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
  </form>
  <span class="l"  style="margin-left: 20px;">
    <a style="display:inline-block;{if(2==$select)}background:#e5e5e5;border-color: #e5e5e5;color: #333;{/if}" class="btn btn-primary" href="{:url('Statistics/betStatistics')}?select=2">今天</a>
    <a style="display:inline-block;{if(3==$select)}background:#e5e5e5;border-color: #e5e5e5;color: #333;{/if}" class="btn btn-primary" href="{:url('Statistics/betStatistics')}?select=3">昨日</a>
    <a style="display:inline-block;{if(4==$select)}background:#e5e5e5;border-color: #e5e5e5;color: #333;{/if}" class="btn btn-primary" href="{:url('Statistics/betStatistics')}?select=4">本周</a>
    <a style="display:inline-block;{if(5==$select)}background:#e5e5e5;border-color: #e5e5e5;color: #333;{/if}" class="btn btn-primary" href="{:url('Statistics/betStatistics')}?select=5">本月</a>
    <a style="display:inline-block;{if(6==$select)}background:#e5e5e5;border-color: #e5e5e5;color: #333;{/if}" class="btn btn-primary" href="{:url('Statistics/betStatistics')}?select=6">上月</a>
  </span>
  <div style="margin-right: 2%;float:right">
					<a class="btn btn-primary radius" href="{:url('statistics/agentStatistics')}?sure=1">
						
						导出EXCEL表格
					</a>
				</div>
  </div>

     <div class="page-container dataTables_wrapper" style="padding-top:0;">
      <div id="tab-system" class="HuiTab">
        <div class="tabCon">
          <div class="mt-20">
            <table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
              <thead>
                <tr class="text-c">
                  <th>彩种</th>
                  <th>注单总量(单)</th>
                  <th>投注总额</th>
                  <th>派彩总额</th>
                  <th>投注人数</th>
                  <th>总注数</th>
                  <th>赢(注)</th>
                  <th>输(注)</th>
                  <th>胜率</th>
                  <th>等级</th>
                  <th>盈亏情况 [投注金额-中奖金额]</th>
                  <th>杀率(%) [(投注金额-中奖金额)/投注金额]</th>
                  <th>占比率(%) [彩种投注金额/总投注金额]</th>
                </tr>
              </thead>
		      {foreach($list as $v)}
              <tbody>
                <tr class="text-c">
					<td>
					<a style="text-decoration:underline" class="ml-5" onclick="checklist('【{$v.name}】注单详情','/admin/statistics/betDetail?type={$v.czid}&start={$start}&end={$end}',1200)" href="javascript:;">
					{$v.name}
					</a>
					</td>
					<td>{$v.count}</td>
					<td>{$v.tzje}</td>
					<td>{$v.zjje}</td>
					<td>{$v.user_count}</td>
          <td>{$v.zhushu_zong}</td>
          <td>{$v.zhushu_ying}</td>
          <td>{$v.zhushu_shu}</td>
          <td>{$v.shenglv}{if condition="$v.shenglv neq ''"}%{/if}</td>
          <td style="color: {if $v.dengji=='高'}red{/if}{if $v.dengji=='中'}blue{/if}{if $v.dengji=='低'}green{/if}">{$v.dengji}</td>
					<td data="{$v.profit_and_loss}" class="fa_zhi"><span class="zhi"></span></td>
					<td>{$v.kill}</td>
					{if($total_money)}
					<td>{$v.tzje*100/$total_money|sprintf='%.2f',###}</td>
					{else /}
					<td>无</td>
					{/if}
                </tr>
		      {/foreach}
		       <tr class="text-c">
                	<td>总计</td>
					<td>{$total.zcount}</td>
					<td>{$total.ztzje|default=0}</td>
					<td>{$total.zzjje|default=0}</td>
					<td>{$total.zuser_count}</td>
          <td>{$total.zhushu_zong}</td>
          <td>{$total.zhushu_ying}</td>
          <td>{$total.zhushu_shu}</td>
          <td>{$total.shenglv}{if condition="$total.shenglv neq ''"}%{/if}</td>
          <td style="color: {if $total.dengji=='高'}red{/if}{if $total.dengji=='中'}blue{/if}{if $total.dengji=='低'}green{/if}">{$total.dengji}</td>
					<td>{$total.all_profit_loss|sprintf='%.2f',###}</td>
					{if($total['ztzje'])}
					<td>{$total.all_profit_loss/$total.ztzje*100|sprintf='%.2f',###}</td>
					{else /}
					<td>无</td>
					{/if}
					<td>100.00</td>
                </tr>
              </tbody>
              
            </table>
          </div>
        </div>
      </div>

    </div>
   </div>

    </div> 
{/block}{block name="js"}
<script type="text/javascript" src="__SYSMET__/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript">
/*查看注单详情*/
function checklist(title,url,w,h){
	layer_show(title,url,w,h);
}
    $(function() {
	  $('.skin-minimal input').iCheck({
	    checkboxClass : 'icheckbox-blue',
	    radioClass : 'iradio-blue',
	    increaseArea : '20%'
	  });
	  $("#tab-system").Huitab({
	    index : 0
	  });
});
var allspan=document.getElementsByClassName('zhi')
var allTd=document.getElementsByClassName('fa_zhi')
//alert(allTd.length)
for(var i=0;i<allspan.length;i++){
  var str_td=parseFloat(allTd[i].getAttribute('data'))
  var str_td_two=str_td.toFixed(2)
	allspan[i].innerHTML=str_td_two
}

</script>

{/block}
